#include <iostream>
#include <vector>

using namespace std;

// https://leetcode.cn/problems/w3tCBm/?envType=problem-list-v2&envId=G25w0aD1

class Solution {
public:
    vector<int> countBits(int n) {
        auto isBin = [](int num) -> int
        {
            int cntOne = 0;
            while (num > 0)
            {
                if((num & 1) == 1)
                {
                    cntOne++;
                }
                num /= 2;
            }
            return cntOne;
        };
        vector<int> ans{0};
        for (int i = 1; i <= n; i++)
        {
            ans.push_back(isBin(i));
        }
        return ans;
    }
};

int main()
{
    return 0;
}